<h2>DESCRIPTION</h2>

<em>v.kcv</em> randomly divides a points lists into <em>k</em> sets of
test/train data (for <b>npartitions</b>-fold <b>c</b>ross <b>v</b>alidation).
Test partitions are mutually exclusive. That is, a point will appear in
only one test partition and <em>k-1</em> training partitions.

The module generates a random point using the selected random number
generator and then finds the closest point to it. This site is removed
from the candidate list (meaning that it will not be selected for any
other test set) and saved in the first test partition file. This is
repeated until enough points have been selected for the test partition.
The number of points chosen for test partitions depends upon the number
of sites available and the number of partitions chosen (this number is
made as consistent as possible while ensuring that all sites will be
chosen for testing). This process of filling up a test partition is
done <em>k</em> times.

<h2>NOTES</h2>

An ideal random sites generator will follow a Poisson distribution and 
will only be as random as the original sites. This module simply 
divides vector points up in a random manner.

<p>
Be warned that random number generation occurs over the
intervals defined by the current region of the map.

<p>
This program may not work properly with Lat-long data.

<h2>EXAMPLES</h2>

All examples are based on the North Carolina sample dataset.

<div class="code"><pre>
g.copy vect=geonames_wake,my_geonames_wake
v.kcv map=my_geonames_wake column=part npartitions=10
</pre></div>

<p>
<div class="code"><pre>
g.copy vect=geodetic_pts,my_geodetic_pts
v.kcv map=my_geodetic_pts column=part npartitions=10
</pre></div>

<h2>SEE ALSO</h2>

<em>
<a href=v.random.html>v.random</a>,
<a href=g.region.html>g.region</a>
</em>


<h2>AUTHOR</h2>

James Darrell McCauley,
<br>when he was at: 
<a href="http://ABE.www.ecn.purdue.edu/ABE/">Agricultural Engineering</a>
<a href="http://www.purdue.edu/">Purdue University</a>

<p>
27 Jan 1994: fixed RAND_MAX for Solaris 2.3<br>
13 Sep 2000: released under GPL<br>
Updated to 5.7 Radim Blazek 10 / 2004<br>
OGR support by Martin Landa (2009)<br>
Speed-up by Jan Vandrol and Jan Ruzicka (2013)

<!--
<p>
<i>Last changed: $Date$</i>
-->
